class Seed
  include MongoMapper::Document

  key :v, Integer, default: 5
  # Should only be set with get_seed
  #TODO: How to make sure of this?
  key :s, String, unique: true, required: true

  def get_seed
    self.s = Digest::SHA2.hexdigest self.id
    s = 0
    while not self.valid?
      s += 1
      self.s = Digest::SHA2.hexdigest self.id + s
    end
  end

end
